func searchRange(nums []int, target int) []int {
    leftBoard := findLeftBoard(nums, target)
    rightBoard := findRightBoard(nums, target)
    if leftBoard == -2 || rightBoard == -2 {
        return []int{-1, -1}
    }
    if rightBoard -leftBoard > 1 {
        return []int{leftBoard+1, rightBoard-1}
    }
    return []int{-1, -1}
}

func findLeftBoard(nums []int, target int) int {
    left, right := 0, len(nums)-1
    leftBoard := -2 // 标记是否找到边界
    for left <= right {
        middle := (left+right)/2
        if nums[middle] >= target {
            right = middle - 1
            leftBoard = right
        } else {
            left = middle+1
        }
    }
    return leftBoard
}

func findRightBoard(nums []int, target int) int {
    left, right := 0, len(nums)-1
    rightBoard := -2 // 标记是否找到边界
    for left <= right {
        middle := (left+right)/2
        if nums[middle] > target {
            right = middle - 1
        } else {
            left = middle + 1
            rightBoard = left
        }
    }
    return rightBoard
}